package com.example.utils;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public class CJUtils {
    // 变量名是否规格化
    public static boolean isVariableNameNormalized = true;
    public static boolean inClass = false;
    public static Set<String> spawnParamSet = new HashSet<>();
    public static Map<String, classNode> classNodes = new HashMap<>();
    public static Map<String, String> defaultValue = new HashMap<>();
    static {
        defaultValue.put("Byte", "0");
        defaultValue.put("Char", "' '");
        defaultValue.put("Bool", "false");
        defaultValue.put("Int8", "0");
        defaultValue.put("Int32", "0");
        defaultValue.put("Float32", "0.0");
        defaultValue.put("Float64", "0.0");
        defaultValue.put("Int64", "0");
        defaultValue.put("Unit", "()");
        defaultValue.put("String", "\"\"");
    }
    public static String getDefaultValue(String rawType){
        if(defaultValue.containsKey(rawType)){
            return defaultValue.get(rawType);
        }
        return "None";
    }
}
